{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "ad09b702-0260-4ba3-91a5-1e2a66100f8c",
   "metadata": {},
   "source": [
    "https://leetcode.com/problems/partition-list/submissions/\n",
    "\n",
    "\n",
    "\n",
    "Runtime: 36 ms, faster than 48.63% of Python3 online submissions for Partition List.\n",
    "Memory Usage: 14.3 MB, less than 60.13% of Python3 online submissions for Partition List.\n",
    "\n",
    "\n",
    "\n",
    "```python\n",
    "class Solution:\n",
    "    def partition(self, head: ListNode, x: int) -> ListNode:\n",
    "        #7:48\n",
    "        l = []\n",
    "        node = head\n",
    "        while node:\n",
    "            l.append(node.val)\n",
    "            node = node.next\n",
    "        a = []\n",
    "        b = []\n",
    "        for val in l:\n",
    "            if val < x:\n",
    "                a.append(val)\n",
    "            else:\n",
    "                b.append(val)\n",
    "        c = a + b\n",
    "        node = head\n",
    "        index = 0\n",
    "        while node:\n",
    "            node.val = c[index]\n",
    "            index += 1\n",
    "            node = node.next\n",
    "        return head\n",
    "        #7:52\n",
    "```"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a7a0f0ee-93ff-46a4-8fe9-edf3bc0819bf",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.6"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
